﻿@model ITProject.WebUI.Models.Account.UserInformationViewModel
@{
    ViewBag.Title = "Edycja profilu";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>


@using (Html.BeginForm("Edit", "Account", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
     @Html.ValidationSummary(true)
     <fieldset>
        <legend>Edycja danych osobowych</legend>
     <div class="editor">
        <div class="editor-label">
            @Html.LabelFor(model => model.FirstName) <span class="validation">*</span>

        </div>
        <div class="editor-field">
        <p class="validation">@Html.ValidationMessageFor(model => model.FirstName)</p>
            @Html.TextBoxFor(model => model.FirstName, new { @class = "input" })
            
        </div>
    </div>
    <div class="editor">
        <div class="editor-label">
            @Html.LabelFor(model => model.LastName) <span class="validation">*</span>
        </div>
        <div class="editor-field">
        <p class="validation">@Html.ValidationMessageFor(model => model.LastName)</p>
            @Html.TextBoxFor(model => model.LastName, new { @class = "input" })
            
        </div>
        </div>
    <div class="editor">
        <div class="editor-label">
            @Html.LabelFor(model => model.BirthDate) <span class="validation">*</span>
        </div>
        <div class="editor-field">
        <p class="validation">@Html.ValidationMessageFor(model => model.BirthDate)</p>
            @Html.TextBoxFor(model => model.BirthDate, new { @class = "input" })
            
        </div>
    </div>
    <div class="editor">
        <div class="editor-label">
            @Html.LabelFor(model => model.Email) <span class="validation">*</span>
        </div>
        <div class="editor-field">
        <p class="validation">@Html.ValidationMessageFor(model => model.Email)</p>
            @Html.TextBoxFor(model => model.Email, new { @class = "input" })
            
        </div>
    </div>
    <div class="editor">
        <div class="editor-label">
            @Html.LabelFor(model => model.OldPassword)
            <p class="editor-info">
            Wypełniasz to pole tylko gdy chcesz zmienić hasło
            </p>
        </div>
        <div class="editor-field">
        <p class="validation">@Html.ValidationMessageFor(model=>model.OldPassword)</p>
            @Html.PasswordFor(model => model.OldPassword, new { @class = "input" })
            </div>
        </div>
        <div class="editor">
            <div class="editor-label">
            @Html.LabelFor(model => model.NewPassword)
            </div>
            <div class="editor-field">
            <p class="validation">@Html.ValidationMessageFor(model=>model.NewPassword)</p>
            @Html.PasswordFor(model => model.NewPassword, new { @class = "input" })
            </div>
            </div>
    <div class="editor">
            <div class="editor-label">
            @Html.LabelFor(model => model.PasswordNew2)
            </div>
            <div class="editor-field">
            <p class="validation">@Html.ValidationMessageFor(model=>model.PasswordNew2)</p>
            @Html.PasswordFor(model => model.PasswordNew2, new { @class = "input" })
            </div>
            </div>
        <p class="validation" style="padding-left:50px">        
        *pola wymagane
        </p>
</fieldset><fieldset>
        <legend>Edycja profil użytkownika</legend>
        <div class="editor">
        <div class="editor-label">
            @Html.LabelFor(model => model.Country)
        </div>
        <div class="editor-field">
                    <p class="validation">@Html.ValidationMessageFor(model=>model.Country)</p>

            @Html.TextBoxFor(model => model.Country, new { @class = "input" })
        </div>
        </div>
        <div class="editor">
        <div class="editor-label">
            @Html.LabelFor(model => model.City)
        </div>
        <div class="editor-field">
        <p class="validation">@Html.ValidationMessageFor(model=>model.City)</p>
            @Html.TextBoxFor(model => model.City, new { @class = "input" })
        </div>
        </div>
        <div class="editor">
        <div class="editor-label">
            @Html.LabelFor(model => model.About)
        </div>
        <div class="editor-field">
        <p class="validation">@Html.ValidationMessageFor(model=>model.About)</p>
            @Html.TextAreaFor(model => model.About, new { @class = "input" })
        </div>
        </div>
        <div class="editor">
        <div class="editor-label">
            @Html.LabelFor(model => model.Interest)
        </div>
        <div class="editor-field">
        <p class="validation">@Html.ValidationMessageFor(model=>model.Interest)</p>
            @Html.TextAreaFor(model => model.Interest, new { @class = "input" })
        </div>
        </div>
        <div class="editor">
        <div class="editor-label">
            @Html.LabelFor(model => model.Experience)
        </div>
        <div class="editor-field">
        <p class="validation">@Html.ValidationMessageFor(model=>model.Experience)</p>
            @Html.TextAreaFor(model => model.Experience, new { @class = "input" })
        </div>
        </div>
        <div class="editor">
        <div class="editor-label">
            @Html.LabelFor(model => model.Skills)
        </div>
        <div class="editor-field">
        <p class="validation">@Html.ValidationMessageFor(model=>model.Skills)</p>
            @Html.TextAreaFor(model => model.Skills, new { @class = "input" })
        </div>
        </div>
        <div class="editor">
        <div class="editor-label">
            @Html.LabelFor(model => model.AvatarPath)
        </div>
        <div class="editor-field">
        <p class="validation">@Html.ValidationMessageFor(model=>model.AvatarPath)</p>
           <input type="file" name="AvatarPath" id="AvatarPath"/> 
        </div>
        </div>
        <div class="editor">
        <div class="editor-label">
            Obecny Avatar
        </div>
        <div class="editor-field">
            Usuń @Html.CheckBoxFor(model => model.AvatarDelete)
            @if (Model.AvatarName != null)
            {
                @:<img src="@Url.Content("~/UserFiles/Avatars/" + Model.AvatarName)" alt="avatar" />
            }
            @Html.HiddenFor(model => model.AvatarName)
         </div>
        </div>


        <p class="validation" style="padding-left:50px">        
        *pola wymagane
        </p>
        <div class="DSubmit">
        <input type="reset" class="button" value="Wyczyść" />
            <input type="submit" class="button" value="Zapisz" />
        </div>

    </fieldset>
}
